var result = {},
    cur_category = {name : undefined , desc : undefined};
$('#documentation').children().each(function(){

  
	var me = $(this),
        method = {category : undefined , category_desc : undefined , name : undefined , method_details_text : undefined, method_details_html : undefined};
  //console.log(me[0].tagName);
  if (me.attr('id') == 'changelog') return false;
  if(me[0].tagName == 'H2'){
  	cur_category.name = me.attr('id');
    cur_category.desc = me.text();
  }
  if(me[0].tagName == 'ARTICLE'){
      method.category = cur_category.name || 'Unknown';
      method.category_desc = cur_category.desc || 'Unknown';
      method.name = me.attr('id');
      method.method_details_text = me.text();
      method.method_details_html = me.html();
      result.push(method);
  }else{
    
  }
  
})
//console.log(result);
console.log(JSON.stringify(result));